<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<script src="/js/jquery-1.4.4.min.js" type="text/javascript"></script>
<script>
    $(document).ready(function () {
        var value;
        var authTime = 0;

        function lo() {
            value = prompt('key ???');
            var valueArray = value.split(",");
            if (valueArray.length < 1 || valueArray.length > 2) {
                alert("输入格式不对");
            } else {
                authTime = valueArray[1];
            }
            value = valueArray[0];
            if (value !== undefined && value != null && value !== '') {
                $.ajax({
                    type: 'post',
                    url: '/loginCheckValue',
                    data: {'value': value},
                    async: false,
                    beforeSend: function (XMLHttpRequest) {

                    },
                    success: function (resultDate, textStatus) {
                        if ('success' === textStatus && 'fail' !== resultDate) {
                            if (authTime === undefined) authTime = 0;
                            window.location.href = '/loginSave?uuid=' + resultDate.key + "&authTime=" + authTime;
                        } else {
                            alert("密码错误!请重试!");
                            lo();
                        }
                    },
                    complete: function (XMLHttpRequest, textStatus) {

                    },
                    error: function () {
                        alert("请重试!");
                        lo();
                    }
                });

            }
        }

        lo();
    })
</script>
</body>
</html>